Variable resistance measuring loop having compensational function for environmental factors

ABSTRACT

A variable resistance measuring loop having compensation function for environmental factor is disclosed. The measuring loop comprises a central processing unit CPU connected by one end of the variable resistance to the PO. 1  leg thereof, and the other end being connected to the PO. 2  leg thereof, the center end thereof being connected to a drain of a charging switch transistor Q, the base of the transistor Q being connected in series with a resistance R to the PO. 3  leg of the CPU, the emitter of the transistor Q being connected to VDD power source end, the drain being conductive with the PO. 0  leg and being connected in series with a charging/discharging capacitor C to a common ground, characterized in that the two ends of the variable resistance is connected to a control loop which is connected to a capacitor charging/discharging and the amount of movement is calculated via a discharging formula, and due to the two ends of the variable resistance is connected, the measuring loop is not affected by environment factors in the mouse cursor controller circuit.

BACKGROUND OF THE INVENTION

[0001] (a) Field of the Invention

[0002] The present invention relates to a variable resistance measuringloop having compensation function for environmental factors, and inparticular, a measuring loop used in a mouse cursor controller whichwill not be affected by environmental factors but will reduce defectrate of circuit and upgrade the precision of the mouse cursorcontroller.

[0003] (b) Description of the Prior Art

[0004] Among computer peripherals, a computer mouse cursor controller isindispensable in operating a computer, for instance, computer mouse,keyboard, handwritten board, joystick are peripherals which providefunction for controlling the movement of the mouse cursor in controllingand operating the computer in documentation and image handling or gamessoftware.

[0005] Conventionally, the mouse cursor controller hardware is used tocontrol the x-axis and y-axis movement on a display. In this controller,a RC charging/discharging circuit calculates the coordinate of movementbased on the charging/discharging of the capacitor C. However, due tothe influence of the environment, for instance, the changes oftemperature and humidity, the value of the capacitor C of the RCcharging/discharging circuit will be easily changed, and this will causean unstable circuit and the controlling of mouse or joystick is notsmooth. In a more serious case, the equipment may be damaged, and oncedamage is occurred, its calibration cannot be restored to its normalstatus.

[0006] Accordingly, it is an object of the present invention to providea variable resistance measuring loop having compensational function forenvironment factors, wherein the loop is used in the mouse cursorcontroller circuit to overcome the above drawbacks.

SUMMARY OF THE INVENTION

[0007] Accordingly, it is an object of the present invention to providea variable resistance measuring loop having compensation function forenvironmental factors, wherein the two ends of the variable resistanceconnected to a control loop which is connected to a capacitorcharging/discharging are employed and the amount of movement iscalculated via a discharging equation, and due to the two ends of thevariable resistance is connected, the measuring loop is not affected byenvironment factors in the mouse cursor controller circuit.

[0008] Yet another object of the present invention to provide a variableresistance measuring loop having compensation function for environmentalfactors, wherein a central processing unit CPU is connected by one endof the variable resistance to the PO.1 leg, thereof and the other end isconnected to the PO.2 leg thereof, the center end thereof is connectedto a drain of a charging switch transistor Q, the base of the transistorQ is connected in series with a resistance R to the PO.3 leg of the CPU,the emitter of the transistor Q is connected to VDD power source end,the drain being conductive with the PO.0 leg and being connected inseries with a charging/discharging capacitor C to a common ground, bymeans of the two ends of the variable resistance is connected to acontrol loop which is connected to a capacitor charging/discharging andthe amount of movement is calculated via a discharging formula, and dueto the two ends of the variable resistance is connected, the measuringloop is not affected by environment factors in the mouse cursorcontroller circuit.

BRIEF DESCRIPTION OF THE DRAWINGS

[0009]FIG. 1 is a circuit diagram of the present invention.

[0010]FIG. 2 is a charging/discharging waveform diagram of the presentinvention.

DETAILED DESCRIPTION OF THE PRESENT INVENTION

[0011] Referring to FIG. 1, there is shown a variable resistancemeasuring loop having compensation function for environmental factorscomprising a central processing unit CPU, a discharging resistance VR, acharging capacitor C, a transistor used as charging switch, a baseresistor R for current controlling.

[0012] In accordance with the present invention, the above CPU is INTEL80c51 compatible, for instance, WINBOND w78c51, wherein the electricalproperties are similar to INTEL 80c51. One end of the variableresistance is connected to PO.1 leg, the other end is connected to thePO.2 leg thereof, the center end thereof is connected to a drain of acharging switch transistor Q, the base of the transistor Q is connectedin series with a resistance R to the PO.3 leg of the CPU, the emitter ofthe transistor Q is connected to VDD power source end, the drain isconductive with the PO.0 leg and is connected in series with acharging/discharging capacitor C to a common ground.

[0013] In accordance with the present invention, the working principleis as follows:

[0014] (1) Charging the loop:

[0015] the PO.0, PO.1, PO.2 of the CPU is set at input mode, and thePO.3 is set at output mode and the output is LOW. At this instance,current from VDD flows via the transistor Q to the capacitor to charge,as the transistor Q is triggered, to saturation, the saturated voltageequals to power source voltage VDD minus the saturated voltage VCE ofthe transistor,

[0016] (2) Discharging the loop:

[0017] the PO.0, PO.2, PO.3 leg of the CPU is set at input mode, andPO.1 is set at output mode, and the output is at LOW. At this instance,the transistor Q is cut off, and the capacitor C charging current flowsthrough RA to PO.1. PO.1 detects the variation of discharging voltage,and the discharging is completed after a period of time. The dischargingwaveforms are shown in FIG. 2

[0018] (2.2) Discharging loop (2):

[0019] the PO.0, PO.1 and PO.3 leg of the CPU is set at input mode, andPO.2 is set at output mode, and the output is low. At this instance, thetransistor is cut off, and the capacitor C charging current flowsthrough RB to PO.2. PO.0 detects the variation of discharging voltage,and charging is completed after a period of time. The dischargingwaveforms are shown in FIG. 2.

[0020] As shown in the figure, the discharging equation is as follows:

[0021] (1) Discharging Equation

[0022] (2) $\begin{matrix}{{{Discharging}\quad {Equation}}\quad \quad {{V\quad o\quad l\quad t\quad a\quad g\quad e\quad f\quad o\quad r\quad c\quad a\quad p\quad a\quad c\quad i\quad t\quad o\quad r\quad V_{C}} = {\left. {V_{D\quad D} \cdot e^{- \frac{t}{R\quad C}}}\Rightarrow e^{- \frac{t}{R\quad C}} \right. = {\left. \frac{V_{C}}{V_{D\quad D}}\Rightarrow{l_{n}e^{- \frac{t}{R\quad C}}} \right. = {\left. {l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow{- \frac{t}{R\quad C}} \right. = {\left. {l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow t \right. = {\left. {{- R}\quad C\quad l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow t \right. = {\left. {R\quad C\quad l_{n}\frac{V_{D\quad D}}{V_{C}}}\Rightarrow t \right. = {{R\quad C\quad l_{n}V_{D\quad D}} - \frac{V_{{ce}{({sat})}}}{V\quad I\quad L}}}}}}}}}} & (1) \\{t_{A} = {\frac{t_{1}}{t_{1} + t_{2}} = {\frac{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}}{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L} + {{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}} = \frac{R_{A}}{R_{A} + R_{B}}}}} & (2) \\{t_{B} = {\frac{t_{2}}{t_{1} + t_{2}} = {\frac{{{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}}{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({SAT})}}}{V\quad I\quad L} + {{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({SAT})}}}{V\quad I\quad L}} = \frac{R_{B}}{R_{A} + R_{B}}}}} & (3)\end{matrix}$

[0023] applying $\begin{matrix}{{J\quad o\quad y\quad s\quad t\quad i\quad c\quad k} = {{\frac{R_{A}}{R_{A} + R_{B}} \times {{Max}.\quad o}\quad u\quad t\quad p\quad u\quad t} = {J\quad o\quad y\quad s\quad t\quad i\quad c\quad k\quad R\quad e\quad p\quad o\quad r\quad t}}} & (1) \\{{M\quad o\quad u\quad s\quad e} = \left. \left. {\frac{R_{A}}{R_{A} + R_{B}} \times 255}\rightarrow{\left. 0 \right.\sim 255} \right.\Rightarrow{{M\quad o\quad u\quad s\quad e\quad m\quad o\quad v\quad e\quad m\quad e\quad {nt}} - {\left. 128 \right.\sim{+ 127}}} \right.} & (2)\end{matrix}$

 R _(A) +R _(B) =V _(R)

R _(A):0˜V _(R)

R _(B):0˜V _(R)

[0024] In view of the above, the present invention employs the two endsof the variable resistance being connected to a control loop which isconnected to a capacitor charging/discharging and the amount of movementis calculated via a discharging formula, and due to the two ends of thevariable resistance is connected, the measuring loop is not affected byenvironment factors in the application in the rrouse cursor controllercircuit.

[0025] While the invention has been described with respect to preferredembodiment, it will be clear to those skilled in the art thatmodifications and improvements may be made to the invention withoutdeparting from the spirit and scope of the invention. Therefore, theinvention is not to be limited by the specific illustrative embodiment,but only by the scope of the appended claims.

1. A variable resistance measuring loop having compensational functionfor environment factors comprising a central processing unit CPUconnected by one end of the variable resistance to the PO.1 leg thereof,and the other end being connected to the PO.2 leg thereof, the centerend thereof being connected to a drain of a charging switch transistorQ, the base of the transistor Q being connected in series with aresistance R to the PO.3 leg of the CPU, the emitter of the transistor Qbeing connected to VDD power source end, the drain being conductive withthe PO.0 leg and being connected in series with a charging/dischargingcapacitor C to a common ground, wherein the charging loop is that thePO.0, PO.1, PO.2 of the CPU are set at input mode, the PO.3 is set atoutput mode and the output is LOW, at this instance, current from VDDflows via the transistor Q to the capacitor to charge, as the transistorQ is triggered, to saturation, the saturated voltage equals to powersource voltage VDD minus the saturated voltage VCE of the transistor,and the discharging loop is: the discharging loop (1): the PO.0, PO.2,PO.3 leg of the CPU are set at input mode, and PO.1 is set at outputmode, and the output is at LOW, at this instance, the transistor Q iscut off, and the capacitor C charging current flows through RA to PO.1,the PO.1 detects the variation of discharging voltage, and thedischarging step is completed after a period of time; the dischargingloop (2): the PO.0, PO.1 and PO.3 leg of the CPU are set at input mode,PO.2 is set at output mode, and the output is low, at this instance, thetransistor Q is cut off, and the capacitor C charging current flowsthrough RB to PO.2, the PO.0 detects the variation of the dischargingvoltage, and the discharging is completed after a period of time;characterized in that the two ends of the variable resistance isconnected to a control loop which is connected to a capacitorcharging/discharging and the amount of movement is calculated via adischarging formula, and due to the two ends of the variable resistanceis connected, the measuring loop is not affected by environment factorsin the application in the mouse cursor controller circuit.
 2. Thevariable resistance measuring loop of claim 1, wherein the dischargingequation is: Discharging Equation $\begin{matrix}{{V\quad o\quad l\quad t\quad a\quad g\quad e\quad f\quad o\quad r\quad c\quad a\quad p\quad a\quad c\quad i\quad t\quad o\quad r\quad V_{C}} = {\left. {V_{D\quad D} \cdot e^{- \frac{t}{R\quad C}}}\Rightarrow e^{- \frac{t}{R\quad C}} \right. = {\left. \frac{V_{C}}{V_{D\quad D}}\Rightarrow{l_{n}e^{- \frac{t}{R\quad C}}} \right. = {\left. {l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow\frac{- t}{R\quad C} \right. = {\left. {l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow t \right. = {\left. {{- R}\quad C\quad l_{n}\frac{V_{C}}{V_{D\quad D}}}\Rightarrow t \right. = {\left. {R\quad C\quad l_{n}\frac{V_{D\quad D}}{V_{C}}}\Rightarrow t \right. = {{R\quad C\quad l_{n}V_{D\quad D}} - \frac{V_{{ce}{({sat})}}}{V\quad I\quad L}}}}}}}}} & \quad \\{t_{A} = {\frac{t_{1}}{t_{1} + t_{2}} = {\frac{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}}{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L} + {{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}} = \frac{R_{A}}{R_{A} + R_{B}}}}} & (2) \\{{t_{B} = {\frac{t_{2}}{t_{1} + t_{2}} = {\frac{{{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({sat})}}}{V\quad I\quad L}}{{{R_{A} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({SAT})}}}{V\quad I\quad L} + {{R_{B} \cdot C}\quad l_{n}V_{D\quad D}} - \frac{V_{{CE}{({SAT})}}}{V\quad I\quad L}} = \frac{R_{B}}{R_{A} + R_{B}}}}}{applying}} & (3) \\{{J\quad o\quad y\quad s\quad t\quad i\quad c\quad k} = {{\frac{R_{A}}{R_{A} + R_{B}} \times {{Max}.\quad o}\quad u\quad t\quad p\quad u\quad t} = {J\quad o\quad y\quad s\quad t\quad i\quad c\quad k\quad R\quad e\quad p\quad o\quad r\quad t}}} & (2) \\{{{M\quad o\quad u\quad s\quad e} = \left. \left. {\frac{R_{A}}{R_{A} + R_{B}} \times 255}\rightarrow{\left. 0 \right.\sim 255} \right.\Rightarrow{{M\quad o\quad u\quad s\quad e\quad m\quad o\quad v\quad e\quad m\quad e\quad {nt}} - {\left. 128 \right.\sim{+ 127}}} \right.}{{R_{A} + R_{B}} = V_{R}}{R_{A}:{\left. 0 \right.\sim V_{R}}}{R_{B}:{\left. 0 \right.\sim V_{R}}}} & (2)\end{matrix}$